package com.lvyq.myplayer.adapter

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentPagerAdapter
import com.lvyq.myplayer.parcelable.MvPagerBeansData
import com.lvyq.myplayer.ui.fragment.MvPlayCommentFragment
import com.lvyq.myplayer.ui.fragment.MvPlayDesFragment


/**
 * 文件描述：MvPlayAdapter 视频播放页
 * 作者：lvyq
 * 创建时间：2025-03-04
 * 修改时间：2025-03-04
 */

class MvPlayAdapter(var data: MvPagerBeansData?, fm: FragmentManager) : FragmentPagerAdapter(fm) {
    override fun getCount(): Int {
        return 2
    }


    override fun getItem(position: Int): Fragment {
        return when(position){
            0-> MvPlayDesFragment(data)
            1-> MvPlayCommentFragment(data?.id)
            else -> throw IllegalArgumentException("未知 position")
        }

    }
}